package com.group02.community.controller;

import com.group02.community.entity.user.SysUser;
import com.group02.community.service.IUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 *   测试-李弘宇-0724
 */
@Api
@RestController
@RequestMapping("/user")
@CrossOrigin
public class UserController {

    @Autowired
    IUserService userService;

//    // 登录
//    @PostMapping("/login")
//    public Map login() {
//        HashMap<String, Object> response = new HashMap<>();
//        HashMap<String, Object> responseData = new HashMap<>();
//        responseData.put("token", 1);
//        response.put("code", 20000);
//        response.put("msg", "登录成功");
//        response.put("data", responseData);
//        return response;
//    }

    // 获取用户信息的方法
    @GetMapping("/info")
    public Map info() {
        HashMap<String, Object> responseInfo = new HashMap<>();
        HashMap<String, Object> responseData = new HashMap<>();
        responseData.put("roles", "admin");
        responseData.put("name", "Super admin");
        responseData.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        responseInfo.put("status", "OK");
        responseInfo.put("msg", "登录成功");
        responseInfo.put("data", responseData);
        return responseInfo;
    }


}
